module.exports={
    data:{
        goTopHideFlag:false
    },
    goTopScroll:function(e){
        var that = this;
        var scrollTop = e.detail.scrollTop;
        wx.getSystemInfo({
            'success': function(res) {
                if (scrollTop >= res.windowHeight) {
                    that.setData({
                        'goTopHideFlag': true
                    });
                    
                }else {
                   that.setData({
                        'goTopHideFlag': false
                    }); 
                }
            },
            'fail': function(res) {
                console.log(res);
            }
        });
    },
    goTopTap:function(){
        this.setData({
            scrollTop: '0',
            goTopHideFlag: false
        });
    }
}